1. Field of the Invention
The present invention relates to an apparatus and method for generating musical tones, using a general-purpose processing apparatus such as a personal computer, and also relates to a method of generating musical tones, and a storage medium storing a program that carries out the same method.
2. Prior Art
In a general-purpose processing apparatus such as a personal computer, musical tones were conventionally generated by using an exclusive tone generator device provided externally of the apparatus, or, by using an expansion board connected to the apparatus and having several IC chips mounted thereon, such as a tone generator chip for generating musical tone waveforms, a ROM that stores waveform data, and a coder/decoder circuit (CODEC) chip equipped with an A/D conversion circuit (analog-to-digital converter), a D/A conversion circuit (digital-to-analog converter; DAC), a FIFO (first-in first-out) buffer, and an interface circuit.
With an increased processing speed of recent CPUs, so-called software tone generators have become used which synthesize musical tones with software using a CPU according to performance information. Such a software tone generator is able to generate musical tones only with a D/A conversion circuit and a FIFO buffer in addition to the CPU and software, without using an exclusive tone generator device or expansion board as described above.
In such a software tone generator, musical tones are normally synthesized by repeatedly reproducing a short period of musical tone waveform data. In one method, for example, musical tones are generated by storing musical tone waveform samples such as WAVE data in a waveform memory, reading out the musical tone waveform samples corresponding to performance information from the waveform memory, and performing specific processing on these waveform samples. In another method, a tone generator of waveform memory type is simulated. A software tone generator that simulates the waveform memory type tone generator produces musical tone waveform data corresponding to one round of sampling timing, by executing for each tone-generating channel waveform operations of LFO (low frequency oscillator), filter EG (envelope generator), and volume EG and the like, based on musical tone control information produced from performance information such as MIDI data, reading out waveform data from a corresponding waveform memory (waveform table), performing an interpolating operation on the waveform data thus read out, computing and producing waveform data for the relevant tone-generating channel by multiplying the thus obtained waveform data by a sample of each type of EG waveform, and accumulating waveform sample data for each tone-generating channel by repeatedly executing the above operations for all tone-generating channels. In the following, such a musical tone generating mode in which a short period of waveform data is repeatedly used shall be called static mode for convenience sake, and the short period of musical tone waveform data produced in this manner shall be called static sound data.
It is also possible to reproduce a large volume of musical tone waveform sample data stored in a hard disk device, CD-ROM, or the like, by using hardware, namely, a D/A conversion circuit and FIFO buffer, necessary in the above-mentioned software tone generator. In this method, which is different from the above-described method in which waveform samples stored in the waveform memory are repeatedly used, musical tone waveform samples stored in a large-capacity storage medium are sequentially read out, and converted from digital signals into analog signals every sampling period, so that a stream of these samples are all reproduced. In the following, such a musical tone generating mode in which all the waveform samples are reproduced as above shall be called streaming mode for convenience sake, and a series of musical tone waveform data generated in this manner shall be called streaming sound data.
The above-described two sound tone generating modes may be employed in the musical tone generating apparatus using the general-purpose processing apparatus. Although each of the two modes may be used alone, these two modes are normally used in a mixed manner such that the static mode is used for some musical tones while the streaming mode is used for other musical tones.
Referring to FIG. 1A, the manner of reproducing sound data generated by such a musical sound generating apparatus will be explained. In FIG. 1A, buffer areas 101-10n are provided in a main memory, to respectively correspond to n tone-generating channels in this musical tone generating apparatus. Some of the n tone-generating channels are adapted to generate musical tones in the static mode as described above, and static sound data are stored in the buffer areas corresponding to these channels. Also, the above-described streaming sound data are stored in the buffer areas corresponding to the other tone-generating channels. The sound data stored in these buffer areas 101-10n are mixed and stored in a buffer 110 for transferring data to CODEC.
The musical tone waveform data stored in the CODEC transfer buffer 110 is transferred to a CODEC (not shown) every predetermined period, transmitted to a D/A converter every sampling period, and then converted by the D/A converter into analog signals, which are then generated as musical tone signals.
FIG. 1B is a view for explaining the processing for reproducing the above-mentioned static sound data. First, a short period of sound data (musical tone waveform data or waveform sample) which is stored in a large-capacity storage device 120, such as a hard disk device or CD-ROM device, or ROM, is transferred only once to a sound data storage area (waveform memory) provided in a main memory 130. Then, the short period of sound data stored in the sound data storage area is repeatedly read out to be synthesized into musical tone waveform data (static sound data) as described above, and then transferred to the buffer 10i of the relevant tone-generating channel. The sound data transferred to this buffer 10i is mixed with data stored in buffers corresponding to other tone-generating channels, and is stored in the buffer 110 for transferring data to CODEC, as shown in FIG. 1A.
FIG. 1C is a view for explaining the processing for reproducing the above-mentioned streaming sound data. In this case, a large volume of sound data stored in a large-capacity storage device 120, such as a hard disk device, are sequentially read out and written into a buffer area provided in a main memory 130. This buffer area is configured as a so-called double buffer, from which sound data is read out in parallel with writing of sound data thereinto, and sequentially transferred to a buffer 10j corresponding to the relevant channel. The data in this buffer 10j is mixed with data in the other channels as described above and is further transferred to the buffer 110 for transferring data to CODEC.
The generation of musical tones by software using such a general-purpose processing apparatus as described above causes a great processing load on the CPU. When developing an application program such as game software that requires many tone-generating channels, therefore, it was unavoidable or necessary to reduce the number of tone-generating channels or lower the quality of musical tones generated. It was also impossible to perform sophisticated processing, such as processing for applying effects to the musical tones generated.